<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:70:"D:\wamp\www\xingjian\public/../application/admin\view\index\index.html";i:1521812528;s:59:"D:\wamp\www\xingjian\application\admin\view\main\index.html";i:1525072559;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>后台管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- basic styles -->
    <link href="/static/admin/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/static/admin/css/font-awesome.min.css" />

    <!--[if IE 7]>
    <link rel="stylesheet" href="/static/admin/css/font-awesome-ie7.min.css" />
    <![endif]-->

    <!-- page specific plugin styles -->


    <!-- ace styles -->

    <link rel="stylesheet" href="/static/admin/css/ace.min.css" />
    <link rel="stylesheet" href="/static/admin/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="/static/admin/css/ace-skins.min.css" />
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="/static/admin/css/ace-ie.min.css" />
    <![endif]-->

    <!-- inline styles related to this page -->

    <!-- ace settings handler -->

    <script src="/static/admin/js/ace-extra.min.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <!--[if lt IE 9]>
    <script src="/static/admin/js/html5shiv.js"></script>
    <script src="/static/admin/js/respond.min.js"></script>
    <![endif]-->

    <!-- 配置文件 -->
    <script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->


</head>

<body>
<!--头部导航-->
<div class="navbar navbar-default" id="navbar">
    <script type="text/javascript">
        try{ace.settings.check('navbar' , 'fixed')}catch(e){}
    </script>

    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small>
                    <i class="icon-leaf"></i>
                    后台管理系统
                </small>
            </a><!-- /.brand -->
        </div><!-- /.navbar-header -->

        <div class="navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
               

                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="/static/admin/avatars/user.jpg" alt="Jason's Photo" />
                        <span class="user-info"><small>欢迎光临,</small><?php echo \think\Session::get('auth.username'); ?></span>
                        <i class="icon-caret-down"></i>
                    </a>

                    <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a href="<?php echo url('admin/login/exitLogin'); ?>">
                                <i class="icon-off"></i>
                                退出
                            </a>
                        </li>
                    </ul>
                </li>
            </ul><!-- /.ace-nav -->
        </div><!-- /.navbar-header -->
    </div><!-- /.container -->
</div>

<!--左侧导航-->
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>

        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
            </script>

            <ul class="nav nav-list">
                <li class="active">
                    <a href="<?php echo url('admin/index/index'); ?>">
                        <i class="icon-dashboard"></i>
                        <span class="menu-text"> 控制台 </span>
                    </a>
                </li>
                <li>
                    <a href="#" class="dropdown-toggle">
                        <!--<i class="icon-desktop"></i>-->
                        <span class="glyphicon glyphicon-lock" style="color:#000000;"></span>
                        <span class="menu-text"> 权限管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showuser" class="btn-userlist">
                                <i class="icon-double-angle-right"></i>
                                管理员列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-useradd">
                                <i class="icon-double-angle-right"></i>
                                添加管理员
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0);" id="assignshow" class="btn-assignshow">
                                <i class="icon-double-angle-right"></i>
                                分配角色
                            </a>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-eye-open"></i>
                        <span class="menu-text"> 角色管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showrole" class="btn-rolelist">
                                <i class="icon-double-angle-right"></i>
                                角色列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-roleadd">
                                <i class="icon-double-angle-right"></i>
                                添加角色
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0);" id="showauth-node" class="btn-auth-nodelist">
                                <i class="icon-double-angle-right"></i>
                                分配节点
                            </a>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-leaf" style="color: #008800;"></i>
                        <span class="menu-text"> 节点管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="shownode" class="btn-nodelist">
                                <i class="icon-double-angle-right"></i>
                                节点列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-nodeadd">
                                <i class="icon-double-angle-right"></i>
                                添加节点
                            </a>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="#" class="dropdown-toggle">
                        <!--<i class="icon-desktop"></i>-->
                        <span class="glyphicon glyphicon-user" style="color:#0d6aad;"></span>
                        <span class="menu-text"> 用户管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showcustomer" class="btn-customerlist">
                                <i class="icon-double-angle-right"></i>
                                用户列表
                            </a>
                        </li>
                    </ul>
                </li>


                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-folder-open" style="color: #ffa500;"></i>
                        <span class="menu-text"> 栏目管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showcate" class="btn-catelist">
                                <i class="icon-double-angle-right"></i>
                                栏目列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-cateadd">
                                <i class="icon-double-angle-right"></i>
                                添加栏目
                            </a>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-tags" style="color: #ff7777;"></i>
                        <span class="menu-text"> 标签管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showtag" class="btn-taglist">
                                <i class="icon-double-angle-right"></i>
                                标签列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-tagadd">
                                <i class="icon-double-angle-right"></i>
                                添加标签
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-text-width" style="color: #000000;"></i>
                        <span class="menu-text"> 文章管理 </span>
                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showarctile" class="btn-arctilelist">
                                <i class="icon-double-angle-right"></i>
                                文章列表
                            </a>
                        </li>

                        <li>
                            <a href="<?php echo url('admin/arctiles/create'); ?>">
                                <i class="icon-double-angle-right"></i>
                                添加文章
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0);" id="showassigntag" class="btn-arc-taglist">
                                <i class="icon-double-angle-right"></i>
                                分配标签
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#" class="dropdown-toggle">
                        <i class="glyphicon glyphicon-flash" style="color: yellow;"></i>
                        <span class="menu-text"> 表情管理 </span>

                        <b class="arrow icon-angle-down"></b>
                    </a>

                    <ul class="submenu">
                        <li>
                            <a href="javascript:void(0);" id="showlook" class="btn-looklist">
                                <i class="icon-double-angle-right"></i>
                                表情列表
                            </a>
                        </li>

                        <li>
                            <a href="javascript:void(0);" class="btn-lookadd">
                                <i class="icon-double-angle-right"></i>
                                添加表情
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!--异步请求页面-->
        <script src="/static/admin/js/jquery-1.8.3.min.js"></script>

        <script>
            function myajax(clickname,showname,url){
                $(clickname).click(function(){
                    $.ajax({
                        type : 'get',
                        url : url,
                        datatype: 'json',
                        success : function(data){
                            $(showname).html(data);
                        }
                    });
                });
            }
            myajax('.btn-userlist','.main-content','/user');
            myajax('.btn-useradd','.main-content','/user/create');
            myajax('.btn-rolelist','.main-content','/role');
            myajax('.btn-roleadd','.main-content','/role/create');
            myajax('.btn-nodelist','.main-content','/node');
            myajax('.btn-nodeadd','.main-content','/node/create');
            myajax('.btn-assignshow','.main-content','/a_role');
            myajax('.btn-auth-nodelist','.main-content','/a_node');
            myajax('.btn-customerlist','.main-content','/customer');
            myajax('.btn-catelist','.main-content','/category');
            myajax('.btn-cateadd','.main-content','/category/create');
            myajax('.btn-taglist','.main-content','/tag');
            myajax('.btn-tagadd','.main-content','/tag/create');
            myajax('.btn-arctilelist','.main-content','/arctile');
            myajax('.btn-arc-taglist','.main-content',"<?php echo url('admin/arctiles/assginTag'); ?>");
            myajax('.btn-imgboxlist','.main-content',"/imgbox");
            myajax('.btn-imgboxadd','.main-content',"/imgbox/create");
            myajax('.btn-imglist','.main-content',"/img");
            myajax('.btn-imgadd','.main-content',"/img/create");
            myajax('.btn-bannerlist','.main-content',"/banner");
            myajax('.btn-banneradd','.main-content',"/banner/create");
            myajax('.btn-looklist','.main-content',"/look");
            myajax('.btn-lookadd','.main-content',"/look/create");
        </script>

        <div class="main-content">
            
<script type="text/javascript" src="/static/admin/js/highcharts.js"></script>
<?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?>
    <input type="hidden" class="id" value="<?php echo $data['id']; ?>">
    <input type="hidden" class="title" value="<?php echo $data['title']; ?>">
    <input type="hidden" class="browse" value="<?php echo $data['browse_num']; ?>">
    <input type="hidden" class="praise" value="<?php echo $data['praise_num']; ?>">
<?php endforeach; endif; else: echo "" ;endif; ?>
<div style="margin: 0 2em">
    <div id="container1" style="min-width: 400px; height: 500px; margin: 0 auto"></div><br />
    <div id="container2" style="min-width: 400px; height: 500px; margin: 0 auto"></div><br />
</div>
<script type="text/javascript">
    statistics();
    function statistics(){
        var id = [];
        var titles = [];
        var browse = []; 
        var praise = []; 
        $('.id').each(function(){
            id.push(parseInt($(this).val()));
        });
        $('.title').each(function(){
            titles.push($(this).val());
        });
        $('.browse').each(function(){
            browse.push(parseInt($(this).val()));
        });
        $('.praise').each(function(){
            praise.push(parseInt($(this).val()));
        });
        console.log(titles);
        var chart;
        $(document).ready(function () {
            //曲线图初始化
            chart = new Highcharts.Chart({
                chart: {
                    renderTo: 'container1',
                    type: 'line',
                    marginRight: 220,
                    marginBottom: 150
                },
                title: {
                    text: '数据曲线图表',
                    x: -20 //center
                },
                subtitle: {
                    text: '最新文章折线统计图',
                    x: -20
                },
                xAxis: {
                    categories: titles
                },
                yAxis: {
                    title: {
                        text: '数据'
                    },
                    plotLines: [{
                        value: 0,
                        width: 2,
                        color: '#808080'
                    }]
                },
                tooltip: {
                    formatter: function () {
                        return '<b>' + this.series.name + '</b><br/><br/>' +
                            this.x + ': ' + this.y + '单位';
                    }
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'top',
                    x: -20,
                    y: 200,
                    borderWidth: 0
                },
                series: [{
                    name: '浏览次数',
                    data: browse
                }, {
                    name: '点赞个数',
                    data: praise
                }]
            });

            //柱形图初始化
            chart = new Highcharts.Chart({
                chart: {
                    renderTo: 'container2',
                    type: 'column'
                },
                title: {
                    text: '数据柱形图表'
                },
                subtitle: {
                    text: '最新文章柱形统计图'
                },
                xAxis: {
                    categories: titles
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: '数据'
                    }
                },
                legend: {
                    layout: 'vertical',
                    backgroundColor: '#FFFFFF',
                    align: 'left',
                    verticalAlign: 'top',
                    x: 100,
                    y: 70,
                    floating: true,
                    shadow: true
                },
                tooltip: {
                    formatter: function () {
                        return '' +
                            this.x + ': ' + this.y + ' 单位';
                    }
                },
                plotOptions: {
                    column: {
                        pointPadding: 0.2,
                        borderWidth: 0
                    }
                },
                series: [{
                    name: '浏览次数',
                    data: browse

                }, {
                    name: '点赞个数',
                    data: praise

                }]
            });

        });
    }

</script>



        </div><!-- /.main-content -->


    </div><!-- /.main-container-inner -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div><!-- /.main-container -->

<!-- basic scripts -->





<!--[if !IE]> -->

<script type="text/javascript">
    window.jQuery || document.write("<script src='/static/admin/js/jquery-2.0.3.min.js'>"+"<"+"script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='/static/admin/js/jquery-1.10.2.min.js'>"+"<"+"script>");
</script>
<![endif]-->

<script type="text/javascript">
    if("ontouchend" in document) document.write("<script src='/static/admin/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
</script>
<script src="/static/admin/js/bootstrap.min.js"></script>
<script src="/static/admin/js/typeahead-bs2.min.js"></script>

<!-- page specific plugin scripts -->



<script src="/static/admin/js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="/static/admin/js/jquery.ui.touch-punch.min.js"></script>
<script src="/static/admin/js/jquery.slimscroll.min.js"></script>
<script src="/static/admin/js/jquery.easy-pie-chart.min.js"></script>
<script src="/static/admin/js/jquery.sparkline.min.js"></script>
<script src="/static/admin/js/ace-elements.min.js"></script>
<script src="/static/admin/js/ace.min.js"></script>



<script type="text/javascript">
    jQuery(function($) {



        $('.sparkline').each(function(){
            var $box = $(this).closest('.infobox');
            var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
            $(this).sparkline('html', {tagValuesAttribute:'data-values', type: 'bar', barColor: barColor , chartRangeMin:$(this).data('min') || 0} );
        });


        var placeholder = $('#piechart-placeholder').css({'width':'90%' , 'min-height':'150px'});
        var data = [
            { label: "social networks",  data: 38.7, color: "#68BC31"},
            { label: "search engines",  data: 24.5, color: "#2091CF"},
            { label: "ad campaigns",  data: 8.2, color: "#AF4E96"},
            { label: "direct traffic",  data: 18.6, color: "#DA5430"},
            { label: "other",  data: 10, color: "#FEE074"}
        ]



        /**
         we saved the drawing function and the data to redraw with different position later when switching to RTL mode dynamically
         so that's not needed actually.
         */
        placeholder.data('chart', data);




        var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
        var previousPoint = null;

        placeholder.on('plothover', function (event, pos, item) {
            if(item) {
                if (previousPoint != item.seriesIndex) {
                    previousPoint = item.seriesIndex;
                    var tip = item.series['label'] + " : " + item.series['percent']+'%';
                    $tooltip.show().children(0).text(tip);
                }
                $tooltip.css({top:pos.pageY + 10, left:pos.pageX + 10});
            } else {
                $tooltip.hide();
                previousPoint = null;
            }

        });

        var d1 = [];
        for (var i = 0; i < Math.PI * 2; i += 0.5) {
            d1.push([i, Math.sin(i)]);
        }

        var d2 = [];
        for (var i = 0; i < Math.PI * 2; i += 0.5) {
            d2.push([i, Math.cos(i)]);
        }

        var d3 = [];
        for (var i = 0; i < Math.PI * 2; i += 0.2) {
            d3.push([i, Math.tan(i)]);
        }


        var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'220px'});


        $('#recent-box [data-rel="tooltip"]').tooltip({placement: tooltip_placement});
        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('.tab-content')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            var w2 = $source.width();

            if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
            return 'left';
        }


        $('.dialogs,.comments').slimScroll({
            height: '300px'
        });


        //Android's default browser somehow is confused when tapping on label which will lead to dragging the task
        //so disable dragging when clicking on label
        var agent = navigator.userAgent.toLowerCase();
        if("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
            $('#tasks').on('touchstart', function(e){
                var li = $(e.target).closest('#tasks li');
                if(li.length == 0)return;
                var label = li.find('label.inline').get(0);
                if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ;
            });

        $('#tasks').sortable({
                opacity:0.8,
                revert:true,
                forceHelperSize:true,
                placeholder: 'draggable-placeholder',
                forcePlaceholderSize:true,
                tolerance:'pointer',
                stop: function( event, ui ) {
                    $(ui.item).css('z-index', 'auto');
                }
            }
        );
        $('#tasks').disableSelection();
        $('#tasks input:checkbox').removeAttr('checked').on('click', function(){
            if(this.checked) $(this).closest('li').addClass('selected');
            else $(this).closest('li').removeClass('selected');
        });
    });
</script>

</body>
</html>

